function activateNavibar(){
	var i = -1, title = $("title").text();
	if(title=="Home"){
		i=0;
	}else if(title=="Discuss"){
		i=1;
	}else if(title=="Feedback"){
		i=2;
	}else if(title=="Exam"){
		i=3;
	}else if(title=="MyZone"){
		i=4;
	}else if(title=="Chat"){
		i=5;
	}else if(title=="More"){
		i=6;
	}else{
		
	}
	
	if(i!=-1){
		$("navbar>ul>li").eq(i).attr("class","active");
		$("navbar>ul>li").eq(i).siblings().attr("class","");
	}

}
activateNavibar();

function getParam(name){
//	console.log(name);
	var dom = document.getElementsByName(name)[0];
	return dom.value;
}
function makeParam(args){
	var params = "";
	for(index in args){
		arg = args[index];
//		console.log(arg);
		params+=(arg+"="+getParam(arg)+"&");		
	}
//	console.log(params.slice(0,-2));
//	return "name="+getParam("name")+"&base_duration="+getParam("base_duration")+"&base_cost="+getParam("base_cost")+"&unit_cost="+getParam("unit_cost")+"&descr="+getParam("descr")+"&cost_type="+getParam("cost_type");
	return params.slice(0,-2);
}

function getHotThreads(callback){
	$.ajax({
		url:"threads/readHotThreads.do",
		type:"POST",
		dataType:"json",
		success: function(jsonData){ callback(jsonData) },
	});	
}